<%--
  Created by IntelliJ IDEA.
  User: Tang'ya'kang
  Date: 2023/5/25
  Time: 18:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>MarchanOrders</title>
</head>
<%@ include file="/manage/head.jsp"%>
<body>
<div class="card">
    <div class="card-body">
        <h5 class="card-title" align="center">所有订单</h5>
        <div class="card-body">
            <table class="table table-hover">
                <thead>
                <tr>
                    <th scope="col">用户编号</th>
                    <th scope="col">订单编号</th>
                    <th scope="col">商品名称</th>
                    <th scope="col">单价</th>
                    <th scope="col">个数</th>
                    <th scope="col">金额</th>
<%--                    <th scope="col">日期</th>--%>
                    <th scope="col">状态</th>
                    <th scope="col">操作</th>

                </tr>
                </thead>
                <tbody>
                <c:forEach items="${requestScope.OrderItems}" var="item" varStatus="status">
                    <tr>
                        <th scope="row">${item.user_id}</th>
                        <th scope="row">${item.oder_id}</th>
                        <td class="book.name">${item.name}</td>
                        <td>${item.price}</td>
                        <td>${item.count}</td>
                        <td>${item.total_price}</td>
                        <c:if test="${item.status eq 0}"><td>未发货</td></c:if>
                        <c:if test="${item.status eq 1}"><td>已发货</td></c:if>
                        <c:if test="${item.status eq 2}"><td>已完成</td></c:if>
                        <c:if test="${item.status eq 0}"><td><a class="badge badge-primary delete" href="./orderItemsServlet?action=SendOutGoods&id=${item.id}&value=1">发货</a></td></c:if>
                        <c:if test="${item.status eq 1}"><td><span class="badge badge-warning">已发货</span></td></c:if>
                        <c:if test="${item.status eq 2}"><td><span class="badge badge-success">Success</span></td></c:if>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
        <%@ include file="/html/AccountPage_Nav.jsp"%>
        <%@ include file="/html/Foot.jsp"%>
    </div>
</div>

</body>
</html>
